package cn.bugDance.domain.activity.repository;

import cn.bugDance.domain.activity.model.aggregate.ActivityPartakeOrderAggregate;
import cn.bugDance.domain.activity.model.aggregate.ActivitySkuOrderAggregate;
import cn.bugDance.domain.activity.model.entity.*;
import cn.bugDance.domain.activity.model.valobj.ActivitySkuStockSubtractionJobData;

import java.util.Date;
import java.util.List;


public interface IActivityRepository {

    ActivityAccountEntity queryActivityAccountByUserIdAndActivityId(String userId, Long activityId);

    void insertActivityAccount(ActivityAccountEntity activityAccountEntity);

    void createActivitySkuOrder(Long activityId, String userId, String bizId);

    ActivityEntity queryActivityByActivityId(Long activityId);


    ActivitySkuEntity queryActivitySkuBySku(Long sku);

    ActivityCountEntity queryActivityCountByCountId(Long activityCountId);

    boolean subtractionActivitySkuStock(Long sku, Date endTime);

    void sendJobQueue(ActivitySkuStockSubtractionJobData activitySkuStockSubtractionJobData);

    ActivitySkuStockSubtractionJobData takeJobQueue(Long sku);

    void activitySkuStockSubtractQuota(Long sku);

    void storeActivitySkuStock(Long sku, Integer stockCount, Date endTime);

    ActivitySkuEntity assembleActivitySku(Long sku);

    ActivityEntity assembleActivity(Long activityId);

    ActivityCountEntity assembleActivityCount(Long activityCountId);

    void saveOrder(ActivitySkuOrderAggregate activitySkuOrderAggregate);

    ActivityPartakeOrderEntity queryActivityPartakeOrderEntity(String userId, Long activityId);

    ActivityMonthAccountEntity queryActivityMonthAccountEntity(String userId, Long activityId, String month);

    ActivityDayAccountEntity queryActivityDayAccountEntity(String userId, Long activityId, String day);

    void saveActivityPartakeOrder(ActivityPartakeOrderAggregate activityPartakeOrderAggregate);

    Integer queryUserDayCount(String userId, Long activityId, String day);

    List<Long> queryRelatedSkus(Long activityId);

    Integer queryUserTotalCountSurplus(String userId, Long activityId);

    Integer queryUserMonthCountSurplus(String userId, Long activityId, String month);

    Integer queryUserDayCountSurplus(String userId, Long activityId, String day);

    Integer queryRaffleActivityAccountPartakeCount(String userId, Long activityId);

    ActivityAccountEntity queryActivityAccount(String userId, Long activityId);

    List<Long> queryActivitySkuAll();

    void clearActivitySkuJobQueue(Long sku);

    void updateActivitySkuStockOver(Long sku);

    void saveCreditPaySkuOrder(ActivitySkuOrderAggregate activitySkuOrderAggregate);

    void updateCreditPayOrder(DeliverOrderEntity deliverOrderEntity);

    List<ActivitySkuEntity> queryActivitySkuByActivityId(Long activityId);

    Integer queryStockSurplusCount(Long sku);

    ActivitySkuOrderEntity queryUnPaidActivitySkuOrder(Long sku, String userId, String tradeType);
}
